package com.badibadi.mytools;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.PopupWindow;

import com.badibadi.activity.InformActivity;
import com.badibadi.infos.ShowDisscussModel;
import com.badibadi.uniclubber.R;

public class PopWindowUtils {

/**
 * 
 * @param context 上下文
 * @param root 视图
 * @param view 要显示在de ImageView的下面
 */
	public static void showPopWindow(final Context context,View root,ImageView view)
	{
//		View root=LayoutInflater.from(context).inflate(R.layout.popwindow0, null);
		final PopupWindow popup=new PopupWindow(root,50, 30);
		popup.setWidth(LayoutParams.WRAP_CONTENT);                  
		popup.setHeight(LayoutParams.WRAP_CONTENT);   
		popup.setBackgroundDrawable(new BitmapDrawable());
		popup.setFocusable(true);
		popup.setTouchable(true);
		popup.setOutsideTouchable(true);
		view.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
//				Utils.showMessage(context, "成功");
				popup.showAsDropDown(v);
			}
		});
	}
}
